<div class="_main">
    {{#each goods_list}}
    <maingoods href="#default/goods_details?id={{_id}}" src="{{preview_img_url}}?imageView/1/w/300/h/300" name="{{goods_name}}" intro="{{intro}}" price="{{price}}"></maingoods>
    {{/each}}
</div>

<xmp type="tag" name="maingoods">
    <div class="maingoods">
        <div class="goodsimg">
            <a href="${href}">
                <img src="${src}" />
            </a>
        </div>
        <div class="goodsinfo">
            <div class="infoitem">
                <span class="name">${name}</span>
            </div>
            <div class="infoitem">
                <span class="intro">${intro}</span>
            </div>
            <div class="infoitem">
                <div class="item">
                    <span class="price">￥${price}</span>
                </div>
                <div class="item right">
                    <button class="btn" event-lclick="{{'$Top.$Event.goods_list.add_to_cart'}}">立即购买</button>
                </div>
            </div>
            <div class="infoitem">
                <a>
                    <div class="lastitem"><i class="icon-bubbles"></i>分享</div>
                </a>
                <a>
                    <div class="lastitem"><i class="icon-star"></i>收藏</div>
                </a>
            </div>
        </div>
    </div>
    <script type="text/vm">
    function(vm){
        var goodsimg=vm.queryElement({
            className:"goodsimg"
        })[0];
        require(['jQuery'],function(){
            var h=$(goodsimg).width()*0.8;
            $(goodsimg).css('height',h);
        })
    }
    </script>
</xmp>